package scala.pattern

/**
 * 2）样例类的使用案例
 */
object MatchUnapplyTest2{
  case  class User (name:String,age:Int)

  def main(args: Array[String]): Unit = {
    val user: User = User("zhangsan", 11)
    println(user match {
      case User("zhang", 1) => "yes"
      case _=> "no"
    })
  }
}
